package cn.fulong.sso.client.utils;

import java.util.Collection;
import java.util.Map;

/**
 * @Version 1.0
 * @Author: 云树
 * @Description:
 * @Date: 2019/2/26
 * @Modify 云树
 * @ModifyDate 2019/2/26
 * @since 1.0
 */
public class CollectionUtils {

    /**
     * @param collection
     * @return 集合是否为空
     */
    public static boolean isEmpty(Collection collection) {
        return collection == null || collection.isEmpty();
    }

    public static boolean isEmpty(Map<?, ?> map) {
        return map == null || map.isEmpty();
    }

    public static boolean isEmpty(Object[] array) {
        return getLength(array) == 0;
    }

    public static int getLength(Object[] array) {
        return array == null ? 0 : array.length;
    }

}
